/*     */
package com.liang.nansheng.common.utils;
/*     */
/*     */

import java.util.regex.Pattern;

/*     */
/*     */ public class RegularUtils
        /*     */ {
    /*     */   public static final String REGEX_USERNAME = "^[a-zA-Z]\\w{5,17}$";
    /*     */   public static final String REGEX_PASSWORD = "^[a-zA-Z0-9]{6,16}$";
    /*     */   public static final String REGEX_MOBILE = "^((13[0-9])|(15[^4,\\D])|(14[57])|(17[0])|(17[7])|(18[0,0-9]))\\d{8}$";
    /*     */   public static final String REGEX_EMAIL = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
    /*     */   public static final String REGEX_CHINESE = "^[一-龥],{0,}$";
    /*     */   public static final String REGEX_ID_CARD = "(^\\d{18}$)|(^\\d{15}$)";
    /*     */   public static final String REGEX_URL = "http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?";
    /*     */   public static final String REGEX_IP_ADDR = "(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)";

    /*     */
    /*     */
    public static boolean isUsername(String username)
    /*     */ {
        /*  57 */
        return Pattern.matches("^[a-zA-Z]\\w{5,17}$", username);
        /*     */
    }

    /*     */
    /*     */
    public static boolean isPassword(String password)
    /*     */ {
        /*  67 */
        return Pattern.matches("^[a-zA-Z0-9]{6,16}$", password);
        /*     */
    }

    /*     */
    /*     */
    public static boolean isMobile(String mobile)
    /*     */ {
        /*  77 */
        return Pattern.matches("^((13[0-9])|(15[^4,\\D])|(14[57])|(17[0])|(17[7])|(18[0,0-9]))\\d{8}$", mobile);
        /*     */
    }

    /*     */
    /*     */
    public static boolean isEmail(String email)
    /*     */ {
        /*  87 */
        return Pattern.matches("^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$", email);
        /*     */
    }

    /*     */
    /*     */
    public static boolean isChinese(String chinese)
    /*     */ {
        /*  97 */
        return Pattern.matches("^[一-龥],{0,}$", chinese);
        /*     */
    }

    /*     */
    /*     */
    public static boolean isIdCard(String idCard)
    /*     */ {
        /* 107 */
        return Pattern.matches("(^\\d{18}$)|(^\\d{15}$)", idCard);
        /*     */
    }

    /*     */
    /*     */
    public static boolean isUrl(String url)
    /*     */ {
        /* 117 */
        return Pattern.matches("http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?", url);
        /*     */
    }

    /*     */
    /*     */
    public static boolean isIpAddr(String ipAddr)
    /*     */ {
        /* 127 */
        return Pattern.matches("(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)", ipAddr);
        /*     */
    }
    /*     */
}

/* Location:           C:\maven\maven3.5\maven3.5\repositor\io\github\maliangnansheng\nansheng-common\3.3.4\nansheng-common-3.3.4.jar
 * Qualified Name:     com.liang.nansheng.common.utils.RegularUtils
 * JD-Core Version:    0.6.2
 */